package com.sirius.meta.mall.coupon.logic.controller;




import com.sirius.meta.mall.common.utils.R;
import com.sirius.meta.mall.coupon.logic.bean.SmsCoupon;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

/**
 * <p>
 * 优惠券信息 前端控制器
 * </p>
 *
 * @author fanxioadiu
 * @since 2021-11-14
 */
@RefreshScope
@RestController
@RequestMapping("/sms/coupon")
public class SmsCouponController {

    @Value("${coupon.user.name}")
    private String name;
    @Value("${coupon.user.age}")
    private Integer age;


    /**
     * 获取会员的优惠券集合
     * @return
     */
    @RequestMapping("/test")
    public R test(){
        return R.ok().put("name", name).put("age", age);
    }

    /**
     * 获取会员的优惠券集合
     * @return
     */
    @RequestMapping("/member/list")
    public R memberCoupons(){
        SmsCoupon smsCoupon = new SmsCoupon();
        smsCoupon.setCouponName("满一千减九百");
        return R.ok().put("coupons", Arrays.asList(smsCoupon));
    }



}
